#pragma once

#pragma pack(1)

struct WMOHeader
{
	ui32 nMaterials;
	ui32 nGroups;
	ui32 nPortals;
	ui32 nLights;
	ui32 nModels;
	ui32 nDoodads;
	ui32 nSets;
	ui32 ambientColor;
	ui32 wmoID;
	float bbox1[3];
	float bbox2[3];
	ui32 liquidType;
};

struct WMOMaterial
{
	ui32 flags1;
	ui32 specularmode;
	ui32 blendmode;
	ui32 ofsTexture_1;
	ui32 color_1;
	ui32 flags_1;
	ui32 ofsTexture_2;
	ui32 color_2;
	ui32 flags_2;
	ui32 color_3;
	ui32 unk[4];
	ui32 tex1;
	ui32 tex2;
};

struct WMOGroupInfo
{
	ui32 flags;
	float bbox1[3];
	float bbox2[3];
	i32 nameOfs;
};

struct WMOLight
{
	ui8 lightType;
	ui8 type;
	ui8 hasAtten;
	ui8 padding;
	ui32 color;
	float position[3];
	float intensity;
	float attenStart;
	float attenEnd;
	float unk[4];
};

struct WMODoodadSet
{
	char name[20];
	ui32 ofsFirst;
	ui32 nDoodads;
	ui32 unused;
};

struct WMODoodadInfo
{
	ui32 ofsMODN;
	float pos[3];
	float rot[4];
	float scale;
	ui32 color;
};

struct MOGP
{
	ui32 nameStart;
	ui32 descStart;
	ui32 flags;
	float bbox1[3];
	float bbox2[3];
	ui16 ofsMOPR;
	ui16 numItems;
	ui16 numBatchesA;
	ui16 numBatchesB;
	ui32 numBatchesC;
	ui8 fogIndices[4];
	ui32 liquidType;
	ui32 groupId;
	ui32 unk[2];
};

struct MOPY
{
	ui8 flags;
	ui8 material;
};

struct MOVI
{
	ui16 p1;
	ui16 p2;
	ui16 p3;
};

struct MOVT
{
	float x;
	float y;
	float z;
};

struct MONR
{
	float x;
	float y;
	float z;
};

struct MOTR
{
	float x;
	float y;
};

struct MOBA
{
	ui32 col1;
	ui32 col2;
	ui32 col3;
	ui32 startIndex;
	ui16 numIndices;
	ui16 startVertex;
	ui16 endVertex;
	ui8 nul;
	ui8 textureId;

};

#pragma pack()